Image processing apparatus, image processing system, and image processing method

ABSTRACT

An image processing apparatus includes a recording control unit for recording, by a recording head, a recording position adjustment chart including a pattern for adjusting a recording position of the recording head discharging ink and a mark formed in a position different from that of the pattern, a reading unit for reading the recording position adjustment chart as image data, a first detection unit for detecting a position and inclination of the recording position adjustment chart when reading the recording position adjustment chart based on the mark, a second detection unit for detecting the position of the pattern based on the position and the inclination detected by the first detection unit, and a determination unit for determining adjustment values for the recording position adjustment based on the image data of the recording position adjustment chart in which the position of the pattern has been detected by the second detection unit.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an image processing apparatus, an imageprocessing system, and an image processing method for adjusting arecording position of a recording head which discharges ink.

2. Description of the Related Art

In a conventional inkjet recording apparatus, a recording positionaldeviation occurs depending on accuracy of a manufacturing process of aprinting head (recording head) or mounting accuracy of the printinghead. For example, a printing positional deviation may occur between amonochrome ink discharge port chip and a color ink discharge port chip,between ink discharge port arrays, between forward printing and backwardprinting, or between paths during multipass printing.

In order to solve such a recording positional deviation, for example, aplurality of patterns is printed while shifting a printing positionunder a print condition corresponding to an adjustment item to output achart. The output chart is read by a scanner, and a pattern position inimage data is detected. Luminance of a pattern in a pattern arraycorresponding to the adjustment item is measured based on the detectedpattern position. It is determined that a pattern with the lowestluminance among the luminance of the measured patterns is a pattern ofan optimal recording position, and an adjustment value is determinedbased on a shifting amount of the pattern. Accordingly, printingposition adjustment can be realized.

Thus, processing for adjusting the printing position based on thepattern luminance in the image data necessitates pattern positiondetection. However, in processing for the pattern position detection,there occurs a problem that the pattern position may deviate in theimage data due to a deviation of a chart installing position in areading apparatus, optical distortion of the reading apparatus, oraccuracy of a manufacturing process of the reading apparatus.

Under such circumstances, various methods have been discussed toaccurately detect a position of a predetermined pattern or object fromimage data. For example, Japanese Patent Application Laid-Open No.11-340115 discusses a technique which extracts a predetermined featureamount from a detected image, generates an abstract pattern of thedetected image based on the feature amount, and extracts a featureamount using a reference image. An abstract pattern of the referenceimage is generated based on the feature amount, and a pattern positionof the reference image is detected in the image data by matching theabstract patterns with each other.

However, the above described conventional technique has the followingproblems. For example, in the technique discussed in Japanese PatentApplication Laid-Open No. 11-340115, processing is performed to obtainfeature amounts such as a density of graphics, a center of gravity, aprincipal axis of inertia, and moment of the principal axis of inertiafrom the detected image. Abstract patterns in which the feature amountsare disposed based on the detected image and the reference image arecreated. The positions of the patterns are detected by matching thecreated abstract patterns with each other. However, calculation time isnecessary for creating the abstract patterns based on the two images,i.e., the detected image and the reference image, so that processingtime for pattern position detection may be increased.

SUMMARY OF THE INVENTION

According to an aspect of the present invention, an image processingapparatus includes a recording control unit configured to record, by arecording head, a recording position adjustment chart including apattern for adjusting a recording position of the recording head whichdischarges ink and a mark formed in a position different from a positionof the pattern, a reading unit configured to read the recording positionadjustment chart as image data, a first detection unit configured todetect a position and inclination of the recording position adjustmentchart when the recording position adjustment chart is read based on themark, a second detection unit configured to detect the position of thepattern based on the position and the inclination detected by the firstdetection unit, and a determination unit configured to determine anadjustment value for the recording position adjustment based on theimage data of the recording position adjustment chart in which theposition of the pattern has been detected by the second detection unit.

According to another aspect of the present invention, acomputer-readable storage medium storing a program for causing acomputer to execute a method for processing an image. The methodincludes recording, on a recording medium, a recording positionadjustment chart including a pattern for adjusting a recording positionof a recording head which discharges ink and a mark formed in a positiondifferent from a position of the pattern, reading the recording positionadjustment chart as image data, detecting a position and inclination ofthe recording position adjustment chart when the recording positionadjustment chart is read based on the mark, detecting the position ofthe pattern based on the position and the inclination detected by afirst detection unit, and determining an adjustment value for therecording position adjustment based on the image data of the recordingposition adjustment chart in which the position of the pattern has beendetected.

According to yet another aspect of the present invention, a method forprocessing an image includes recording, on a recording medium, arecording position adjustment chart including a pattern for adjusting arecording position of a recording head which discharges ink and a markformed in a position different from a position of the pattern, readingthe recording position adjustment chart as image data, detecting aposition and inclination of the recording position adjustment chart whenthe recording position adjustment chart is read based on the mark,detecting the position of the pattern based on the position and theinclination detected by a first detection unit, and determining anadjustment value for the recording position adjustment based on theimage data of the recording position adjustment chart in which theposition of the pattern has been detected.

According to the present invention, concerning pattern positiondetection of image data, highly accurate pattern position detection canbe performed within a short calculation time without creating anabstract pattern by obtaining feature amounts of an image.

Further features and aspects of the present invention will becomeapparent from the following detailed description of exemplaryembodiments with reference to the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings, which are incorporated in and constitute apart of the specification, illustrate exemplary embodiments, features,and aspects of the invention and, together with the description, serveto explain the principles of the invention.

FIG. 1 is a block diagram illustrating a configuration of an imageprocessing apparatus according to a first exemplary embodiment.

FIG. 2 is a flowchart illustrating a procedure of printing positionadjustment according to the first exemplary embodiment.

FIG. 3 illustrates a printing position adjustment chart according to thefirst exemplary embodiment.

FIG. 4 illustrates another printing position adjustment chart accordingto the first exemplary embodiment.

FIG. 5 is a flowchart illustrating a procedure of printing positiondetection according to the first exemplary embodiment.

FIG. 6 illustrates processing for obtaining inclination of a printingposition adjustment chart.

FIGS. 7A to 7C illustrate processing for obtaining a pattern analysisarea.

FIGS. 8A and 8B illustrate processing for obtaining a sheet surfaceluminance and a pattern luminance.

FIGS. 9A and 9B illustrate template matching processing.

FIGS. 10A and 10B are appearance perspective views of a recordingapparatus according to the first exemplary embodiment.

FIG. 11 illustrates a configuration of a recording unit according to thefirst exemplary embodiment.

DESCRIPTION OF THE EMBODIMENTS

Various exemplary embodiments, features, and aspects of the inventionwill be described in detail below with reference to the drawings.

First, a multifunction recording apparatus (hereinafter, referred to asa multifunctional peripheral (MFP)) to which the present invention canbe applied will be described. FIGS. 10A and 10B are appearanceperspective views of an MFP 100.

The MFP 100 has a printer function, a scanner function, and an externalmemory reading function. A printer unit (image recording unit) forrealizing the printer function includes an inkjet recording apparatus. Ascanner unit (reading unit) for realizing the scanner function includesan optical scanner.

FIG. 10A illustrates a state where a document cover 51 of the scannerunit and a sheet discharge tray 54 of the printer unit are closed. FIG.10B illustrates a state where the document cover 51 is opened, so that aplaten 52 for placing an image document. FIG. 10B also illustrates astate where an automatic sheet feeder (ASF) 53 for placing recordingpaper and the sheet discharge tray 54 are opened. The scanner unitincludes a charge coupled device (CCD), and reads a document image fromthe CCD to output analog luminance signals of red (R), green (G), andblue (B). The scanner unit may use a contact image sensor (CIS) in placeof the CCD.

In FIGS. 10A and 10B, on a right upper portion of the MFP 100, anoperation panel 16 which includes an operation unit 14 having aplurality of keys and buttons and a display unit (liquid crystal display(LCD)) 15. In the center of a right side surface of the MFP 100, a cardinterface 57 is provided. For example, a memory card storing an imagefile captured by a digital still camera and recorded can be insertedinto the card interface 57. The image file stored in the memory card isread to the MFP 100 by a user performing a predetermined operation fromthe operation unit 14, and the image can be recorded by the printerunit.

FIG. 11 is a perspective view illustrating a configuration of theprinter unit (inkjet recording apparatus) of the MFP 100 illustrated inFIGS. 10A and 10B. A paper feed roller pair 211 rotates while holding arecording medium (print medium) 101 between two rollers to convey therecording medium in a sub-scanning direction. A platen 216 supports anarea in which recording is performed on the conveyed recording medium101 from below, and maintains an interval between the recording medium101 and a discharge port surface of a recording head 215 at anappropriate value.

The recording head 215 is detachably mounted to a carriage 214 whichmoves along a guide shaft 213, and moves in a main scanning directionwhile discharging ink droplets from a plurality of discharge ports (ornozzles) based on a recording signal. Accordingly, recording of onerecording scanning amount is performed on the recording medium 101. Whenone batch of a recording scanning operation is performed, the recordingmedium 101 is conveyed in the subs-canning direction by an amountcorresponding to a recording width of the recording head 215. Images aresequentially formed on the recording medium 101 by alternately repeatingsuch a recording scanning operation and conveyance operation.

The recording head 215 includes two chips, i.e., a monochrome chip and acolor chip, on its discharge port surface. The monochrome chip includesa black nozzle array for discharging black ink. The color chip includesthree nozzle arrays for discharging cyan, magenta, and yellow inks whichare disposed in the main scanning direction.

Ink discharged from the recording head 215 is supplied from an inksupply device (not illustrated) fixed in the inkjet recording apparatus.The inkjet recording apparatus includes, though not illustrated, arecording medium supply unit for supplying the recording medium 101before recording to the paper feed roller 211, and a recording mediumdischarge unit for discharging the recording medium after recording. Inorder to stably obtain effects of the present invention, the inkjetrecording apparatus can include a recovery unit for performingmaintenance processing of the recording head 215, and a spare auxiliaryunit. As such units, there can be cited a capping unit for capping thedischarge port surface of the recording head, a cleaning unit for wipingout foreign objects from the discharge port surface, a unit forpressurizing or sucking the inside of the discharge port, and a unit forreceiving discharged spare ink.

FIG. 1 is a block diagram of the MFP 100. A central processing unit(CPU) 2 of a microprocessor type operates based on a control programstored in a program memory 4 connected via an internal bus 3 andcontents of a data memory 5 of a random access memory (RAM) type. Aprinting recording mechanism 12 is a printer unit which includes aninkjet type printer. The CPU 2 operates, via a recording control unit11, the printing recording mechanism 12, reads printing recording datastored in a printing buffer memory 10, transmits the data to theprinting recording mechanism 12, and prints and records the data on therecording medium, thereby realizing a printing operation. A readingmechanism 7 is a scanner unit based on a CCD system for reading aphotograph or a magazine as image data.

The CPU 2 operates, via a reading control unit 6, the reading mechanism7, and stores image data read by an image sensor (not illustrated)disposed in the reading mechanism 7 in a reading buffer memory 8 of thedata memory 5, thereby realizing a reading operation. The image datastored in the reading buffer memory 8 is read by a data conversion unit9, converted into printing recording data, and then stored in theprinting buffer memory 10 in the data memory 5. The CPU 2 operates, viathe recording control unit 11, the printing recording mechanism 12,reads the printing recording data stored in the printing buffer memory10, transmits the data to the printing recording mechanism 12, andprints and records the data on the recording medium, thereby realizing acopying operation.

The data memory 5 includes an image memory 13 which temporarily storesvarious pieces of image data in addition to the image data read by thereading mechanism 7 to enable editing the image data. The image datastored in the image memory 13 is read and converted into the printingrecording data by the data conversion unit 9, and subjected to aprinting recording operation, so that a photographic image and otherscan be printed in addition to a copying operation. The reading buffermemory 8, the printing buffer memory 10, and the image memory 13 on thedata memory 5 can be operated, under control of the CPU 2, bydynamically changing capacity distribution of the memories andallocating capacities based on an operation status such as an operationmode or user setting. The data conversion unit 9 performs imageprocessing such as image analysis, thumbnail creation, thumbnailcorrection, and output image correction. The CPU 2 can realize imageprocessing of printing position adjustment described below and others byexecuting image processing for the image data stored in the data memory5.

The MFP 100 includes the operation panel 16 including the display unit15 such as a light emitting diode (LED) or a liquid crystal display(LCD) and he operation unit 14 including various keys. The operationpanel 16 enables an operator to execute various input operations ordisplay of an operation status. An interface control unit 17 controlscommunication performed via an external bus 18, and transmits andreceives data to and from an external device 19 connected to theoutside. A personal computer can be connected as the external device 19.The personal computer receives printing recording data generated by aprinter driver running on the computer, and prints and records the data.The personal computer is connected as the external device 19. Thepersonal computer receives a reading request from a scanner driverrunning on the computer, transmits the image data stored in the readingbuffer memory 8, and reads a document.

FIG. 2 is a flowchart illustrating a procedure of printing positionadjustment in the MFP 100 according to the present exemplary embodiment.In step S101, the operator instructs the MFP 100 to print a printingposition adjustment chart (recording position adjustment chart) via thedisplay unit 15. The MFP 100 received a print instruction prints andoutputs the printing position adjustment chart on a print medium by theprinting recording mechanism 12.

In step S102, the operator places the printing position adjustment chartoutput by the printing recording mechanism 12 on a platen of the readingmechanism 7 according to an instruction from the operation unit 14.After placing the printing position adjustment chart, the operatorinstructs the MFP 100 to read the printing position adjustment chart viathe display unit 15.

In step S103, the MFP 100 controls the reading control unit 6 to causethe reading mechanism 7 to read the printing position adjustment chart.The read image data is stored in the reading buffer memory 8 of the datamemory 5. In parallel with the reading operation, the image data storedin the reading buffer memory 8 is subjected to image processing by thedata conversion unit 9 and stored in the image memory. In the presentexemplary embodiment, in order to reduce an influence of interferencesdue to a difference between printing resolution and reading resolutionand to reduce a memory capacity of the image data, the following readingis performed. The reading mechanism 7 performs the reading operation atan 8-bit gray scale, 600 dpi, and γ 1.0, and stores the image data inthe reading buffer memory 8. The data conversion unit 9 performs reducedmagnification processing by bicubic interpolation for the stored imagedata to 300 dpi. The reduced image data is stored in the image memory13.

In step S104, the MFP 100 performs pattern position detection processingfor the image data of the printing position adjustment chart stored inthe image memory 13. The pattern position detection processing will bedescribed in detail below referring to FIG. 4.

In step S105, the MFP 100 performs pattern analysis based on a result ofthe pattern position detection in step S104. The pattern analysis isprocessing for obtaining, based on a pixel value in an area of apredetermined amount from a position of the pattern, an averageluminance of the area.

In step S106, the MFP 100 determines a pattern on an optimal printingposition based on a result of the pattern analysis in step S105. Thepattern of the optimal printing position is a pattern with the lowestaverage luminance in the pattern analysis in step S105.

In step S107, the MFP 100 sets an adjustment value for printing positionadjustment based on printing conditions of the pattern of the optimalprinting position determined in step S106.

FIG. 3 illustrates the printing position adjustment chart printed instep S101 in FIG. 2 according to the present exemplary embodiment. Theprinting position adjustment chart illustrated in FIG. 3 includes fivetypes of pattern arrays, however the types of pattern arrays do notlimit a number of adjustment items. The printing position adjustmentchart is printed on a print medium 101. A printing position adjustmentchart area 102 printed on the print medium 101 is an area located withina reading range in the reading processing of the printing positionadjustment chart in step S103 in FIG. 2.

A reference mark A 103 is a concentric circular mark as illustrated andunchanged in rotation. The reference mark A 103 is set as a referenceposition of a printing position of each pattern. A reference mark B 104is a circular mark as illustrated. A position of the reference mark B104 is referred to in processing for obtaining chart inclination of theimage data in FIG. 6 described below. Thus, a center position of thereference mark B 104 on the left upper portion and a center position ofthe reference mark A 103 are printed to coincide with each other in ahorizontal direction.

A printing position adjustment pattern array PA 105 is for betweenforward printing and backward printing. The pattern array PA is set byshifting a printing position between the forward printing and thebackward printing by 1200 dpi. Patterns PA1, PA2, PA3, PA4, and PA5constituting the pattern array are shifted from each other by +2 dots,+1 dot, 0 dot, −1 dot, and −2 dots. Each pattern printed in the forwardprinting and a pattern printed in the backward printing is a horizontalstriped pattern. When there is a printing positional deviation betweenthe forward printing and the backward printing, an overlapping amount ofhorizontal stripes changes corresponding to the deviation amount,causing a change in luminance. In the present exemplary embodiment, whenthere is no printing positional deviation a luminance of the pattern isthe lowest and the luminance increases corresponding to a deviation of aprinting position.

A printing position adjustment pattern array PB 106 is for between twoink discharge port arrays. The pattern array PB is set by shifting aprinting position between the ink discharge port arrays by 1200 dpi.Patterns PB1, PB2, PB3, PB4, and PB5 constituting the pattern array areshifted from each other by +2 dots, +1 dot, 0 dot, −1 dot, and −2 dots.A pattern printed in a first array and a pattern printed in a secondarray are horizontal striped patterns. When there is a printingpositional deviation between the ink discharge port arrays, anoverlapping amount of horizontal stripes changes corresponding to thedeviation amount, causing a change in luminance. In the presentexemplary embodiment, when there is no printing positional deviation aluminance of the pattern is the lowest and the luminance increasescorresponding to a deviation of a printing position.

FIG. 4 illustrates information about each pattern printing position anda width and a height of each pattern of the printing position adjustmentchart printed in step S101 in FIG. 2 according to the present exemplaryembodiment. A table in the drawing shows, from a left column, eachpattern name, a pattern left upper end position DX from the referencemark A, a pattern left upper end position DY from the reference mark A,a pattern width SW, and a pattern height SH. The information in thedrawing is recorded in advance in the program memory 4 of the MFP 100.Each recorded information is referred to in pattern position detectionprocessing described below referring to FIGS. 7A to 7C.

FIG. 5 is a flowchart illustrating a procedure for pattern positiondetection included in the procedure of the printing position adjustmentin FIG. 2 according to the present exemplary embodiment.

In step S201, the MFP 100 detects the reference mark A 103 from theimage data stored in the image memory 13. The reference mark A 103 isthe concentric circular pattern unchanged in rotation, and hence aposition thereof can be detected based on pattern matching byone-dimensional raster scanning. The MFP 100 performs binarydetermination of black and white for each pixel by a predeterminedthreshold value based on a luminance value, and detects a centerposition of the reference mark A 103 by determining whether a result ofthe determination is a pattern of white, black, white, black, white,black, and white with a predetermined width. The MFP 100 can acquire amore accurate position of the reference mark A by obtaining a center ofgravity of a density of a predetermined area including the referencemark A 103 based on the position detected based on the pattern matchingby the raster scanning.

The MFP 100 detects the reference mark B 104 from the image data storedin the image memory 13. The reference mark B 104 is the circularpattern. The MFP 100 can detect the reference mark B 104 by analyzing apredetermined area based on information about a distance from thereference mark A 103 recorded in the program memory 4. The MFP 100performs binary determination of black and white for each pixel in thepredetermined area by a predetermined threshold value based on aluminance value, and detects a position of the reference mark B 104 bydetecting an area of a black pixel having a predetermined area or more.The MFP 100 can acquire a more accurate position by obtaining a centerof gravity of a predetermined area including the reference mark B 104.

In step S202, the MFP 100 obtains inclination 201 of the printingposition adjustment chart of the image data based on the positions ofthe reference mark A 103 and the reference mark B 104. Detectionprocessing of the inclination 201 of the chart will be described indetail below referring to FIG. 6. In steps S201 and S202, the CPU 2functions as a first detection unit to detect a position and inclinationof a recording position adjustment chart according to a control programstored in the program memory 4.

In step S203, the MFP 100 determines whether the processing of patternposition detection is completed. The MFP 100 checks whether processingin steps S204 to S210 have been executed for all the patterns. If theMFP determines that the pattern position detection has not been executedfor all patterns (NO in step S203), the MFP 100 executes processing instep S204. If it has been executed for all patterns (YES in step S203),the MFP 100 terminates the processing of the pattern position detection.

In step S204, the MFP 100 detects a pattern position based on theposition of the reference position mark A 103, the inclination 201 ofthe chart, and the pattern position information illustrated in FIG. 4. Apattern position (PX, PY) is represented by the following expression(1), where (OX, OY) denotes a position of the reference position mark A,a θ radian denotes inclination of the chart, and (DX, DY) denotespattern position information of a detection target:

PX=(DX*cos θ)−(DY*sin θ)+OX

PY=(DX*sin θ)+(DY*cos θ)+OY  (1)

The pattern position (PX, PY) corresponds to a pattern position 302 inFIG. 7A described below. The pattern position (PX, PY) includes aposition detection error of the reference position mark A 103 or anerror during printing or reading, and hence the pattern position may notcoincide with a patch left upper end position of the image data.

In step S205, the MFP 100 determines whether a position of a pattern ofthe same pattern array as that of the pattern of the position detectiontarget has been detected. This processing is for determining whether toexecute template image creation processing in order to detect anaccurate pattern position. A template image used for detecting aposition of a pattern of the same array has a similar image. If atemplate image has been created in the same array, a position of thepattern of the same array can be detected using the template image. Theuse of a single template image for detecting the position of the patternof the same array can omit processing time of template image creation.If a position of a pattern of the same array is yet to be detected (NOin step S205), the processing proceeds to step S206. If a position of apattern of the same array has been detected (YES In step S205), theprocessing proceeds to step S209.

In step S206, the MFP 100 determines a sheet surface area 303 based onthe pattern position acquired in step S204, and obtains a sheet surfaceluminance 403. The processing in step S206 will be described in detailbelow referring to FIG. 8A.

In step S207, the MFP 100 determines a pattern area 304 based on thepattern position acquired in step S204, and obtains a pattern luminance404. The processing in step S206 will be described in detail belowreferring to FIG. 8A.

In step S208, the MFP 100 creates a template image 305 based on thesheet surface luminance 403 and the pattern luminance 404 respectivelyobtained in steps S206 and S207. The created template image 305 isstored in the image memory 13. The template image creation processingwill be described in detail below referring to FIG. 8B.

In step S209, the MFP 100 performs, based on the pattern positionacquired in step S204, template matching between a predetermined area306 of the image data and the template image created in step S208. Theprocessing in step S209 will be described in detail below referring toFIG. 9A.

In step S210, the MFP 100 determines an accurate pattern position basedon a result of the template matching acquired in step S209. Theprocessing in step S210 will be described in detail below referring toFIG. 9C.

In steps S208 and S209, the CPU 2 performs, according to the controlprogram stored in the program memory 4, template matching for apredetermined area determined based on the position and the inclinationof the recording position adjustment chart. The CPU 2 functions as asecond detection unit to determine a pattern position based on a resultof the template matching.

Step S204 and steps S206 to S210 are illustrated in FIGS. 7A to 7Cdescribed below.

FIG. 6 illustrates the processing in step S202 in FIG. 5 for obtainingthe inclination of the printing position adjustment chart according tothe present exemplary embodiment. The processing is based on anassumption that a print medium 101 is placed on the platen and read. Theprinting position adjustment chart area 102 also inclines when duringprinting, the print medium 101 is obliquely conveyed and the chart isobliquely printed.

An inclination 201 of the chart is obtained based on the reference markA 103 and the reference mark B 104. The inclination θ radian of thechart is represented by the following expression (2), where (AX, AY)denotes coordinates of the reference mark A 103 and (BX, BY) denotescoordinates of the reference mark B 104:

θ=arctan((BY−AY)/(BX−AX))  (2)

FIGS. 7A to 7C illustrate the processing in steps S204 to S210 in FIG. 5according to the present exemplary embodiment. The processing will bedescribed by taking an example of pattern position detection of thepattern PA2. FIG. 7A illustrates a position 301 of the reference mark Aacquired in step S201 in FIG. 2, and a pattern position 302 acquired instep S204 in FIG. 2. As illustrated in FIG. 5, the pattern position 302includes a position detection error of the reference position mark A 103and an error during printing or reading, and hence the position 302 maynot coincide with the patch left upper end position of the image data.

Further, FIG. 7A illustrates a sheet surface area 303 for obtaining asheet surface luminance determined based on the pattern position 302 instep S206 in FIG. 2, a pattern area 304 for obtaining a patternluminance determined based on the pattern position 302 in step S207 inFIG. 2, and a template image 305 created in step S208 in FIG. 2.Creation processing of the template image 305 will be described indetail below referring to FIGS. 8A and 8B.

FIG. 7B illustrates a searching range 306 of the template matchingdetermined based on the pattern position in step S209 in FIG. 2. FIG. 7Cillustrates a pattern analysis area 307 acquired based on the accuratepattern position recorded in step S210 in FIG. 2.

FIGS. 8A and 8B illustrate the processing in steps S206 and S207 and theprocessing in step S208 in FIG. 5 according to the present exemplaryembodiment. FIG. 8A illustrates the processing in steps S206 and S207 inFIG. 5. A sheet surface luminance 403 is obtained by averaging pixelvalues in the sheet surface area 303 for obtaining a sheet surfaceluminance determined based on an offset 401 from a pattern position of asheet surface luminance acquisition area stored in advance from thepattern position 302. FIG. 8A illustrates a pattern luminance 404. Thepattern position 302 includes an error as described above referring toFIG. 5, and hence the offset 401 from the pattern position of the sheetsurface acquisition area and the sheet surface area 303 for obtaining asheet surface luminance take values based on the error. Thus, the sheetsurface area 303 for obtaining the sheet surface luminance is includedin the sheet surface area.

The pattern luminance 404 is obtained by averaging pixel values in thepattern area 304 for obtaining the pattern luminance determined based onthe offset 402 from the pattern position of the pattern luminanceacquisition area stored in advance from the pattern position 302. Theoffset 402 from the pattern position of the pattern luminanceacquisition area and the pattern area 304 for obtaining the patternluminance take values based on the error of the pattern position 302.Thus, the pattern area 304 for obtaining the pattern luminance isincluded in the pattern area.

FIG. 8B illustrates processing for creating a template image 305 basedon the sheet surface luminance and the pattern luminance obtained inFIG. 8A. The template image 305 is divided into four upper, lower, leftand right areas from an image center in order to detect a left upper endposition of a pattern. A pixel value of the lower left area of the fourdivided areas is set to a pattern luminance 404. A pixel value of eachof the other areas is set to a sheet surface luminance 403. If there isinclination 201 of the chart, as illustrated, inclination of an amountequal to that of the inclination 201 of the chart is added with a leftupper end of the area of the pattern luminance set as a rotationalcenter to create a template image 305.

FIGS. 9A and 9B illustrate the template matching processing in step S209in FIG. 5 according to the present exemplary embodiment. FIG. 9Aillustrates processing for acquiring a difference by raster-scanning thetemplate image with respect to a searching range 306 of thepredetermined area of the image data. A pattern 501 is a target patternfor pattern position detection. The template image 305 is moved in adirection 502 during the raster scanning.

In the present exemplary embodiment, a sum of squared difference (SSD)is used as a template matching method. The SSD is represented by thefollowing expression (3), where M*N denotes a size of a template image,T (i, j) denotes a pixel value in a template position (i, j), and I (i,j) denotes a pixel value of image data superimposed on the templateimage.

[Math.  1] $\begin{matrix}{R = {\sum\limits_{j = 0}^{N - 1}{\sum\limits_{i = 0}^{M - 1}\left( {{I\left( {i,j} \right)} - {T\left( {i,j} \right)}} \right)^{2}}}} & (3)\end{matrix}$

FIG. 9B illustrates a position where a difference R obtained by theexpression (3) in FIG. 9A is smallest, more specifically, a positionwhere the template image 305 within the searching range 306 is mostsimilar. The template image includes a pattern left upper end portion503. The pattern left upper end portion 503 of the template image islocated in the left upper end portion of the target pattern for patternposition detection. Thus, an accurate pattern position can be acquiredbased on the position where the difference R is smallest and the patternleft upper end portion 503 of the template image.

In the present exemplary embodiment, the template matching based on theSSD has been described. However, a template matching method of patternposition detection is not limited to the SSD. Other template matchingmethods such as a sum of absolute differences (SAD) and a normalizedcross-correlation (NCC) may be used.

As apparent from the above descriptions, in pattern position detectionof image data, highly accurate and highly robust position detection canbe performed within a short period of time without obtaining any featureamount of an image to create an abstract pattern. Further, patternmatching can be performed without preparing any template image forpattern matching.

The object of the present invention of enabling highly accurate patternposition detection within a short calculation period of time can beachieved as long as a recording position adjustment value is determinedbased on image data read by the reading unit such as a scanner unit.Thus, an image processing apparatus to which the present invention canbe applied may be, in addition to the multifunction recording apparatusincluding the printing unit and the scanner unit, an external deviceconnected to the recording apparatus via an external interface (I/F).The above described processing can be performed by both of the recordingapparatus and the external device. In this case, an image processingsystem including the recording apparatus and the external deviceachieves the object of the present invention.

The object of the present invention can also be achieved by thefollowing manner. More specifically, a storage medium recording aprogram code of software for realizing the above described function issupplied to a system or an apparatus, and a computer of the system orthe apparatus reads the program code stored in the storage medium toexecute the program code. In this case, the program code read from thestorage medium itself realizes a novel function of the presentinvention, and the storage medium storing the program code is within thepresent invention. As the storage medium for supplying the program code,for example, a flexible disk, a hard disk, an optical disk, amagneto-optical disk, a compact disk read-only memory (CD-ROM), acompact disk readable (CD-R), a magnetic tape, a nonvolatile memorycard, or a ROM can be used. The function of the exemplary embodiment canbe realized by executing the read program code via the computer. Anoperating system (OS) operating on the computer performs apart or allparts of actual processing based on an instruction of the program code,and the function of the exemplary embodiment can be achieved by theprocessing.

In the exemplary embodiment, the scanner unit reads the luminance of therecording position adjustment pattern to adjust the recording position.However, the recording position may be adjusted based on another opticalinformation such as a reflection optical density OD.

While the present invention has been described with reference toexemplary embodiments, it is to be understood that the invention is notlimited to the disclosed exemplary embodiments. The scope of thefollowing claims is to be accorded the broadest interpretation so as toencompass all modifications, equivalent structures, and functions.

This application claims priority from Japanese Patent Application No.2009-157027 filed Jul. 1, 2009, which is hereby incorporated byreference herein in its entirety.

What is claimed is:
 1. An image processing apparatus comprising: arecording control unit configured to record, by a recording head, arecording position adjustment chart including a pattern for adjusting arecording position of the recording head which discharges ink and a markformed in a position different from a position of the pattern; a readingunit configured to read the recording position adjustment chart as imagedata; a first detection unit configured to detect a position andinclination of the recording position adjustment chart when therecording position adjustment chart is read based on the mark; a seconddetection unit configured to detect the position of the pattern based onthe position and the inclination detected by the first detection unit;and a determination unit configured to determine an adjustment value forthe recording position adjustment based on the image data of therecording position adjustment chart in which the position of the patternhas been detected by the second detection unit.
 2. The image processingapparatus according to claim 1, wherein the second detection unitdetects the position of the pattern based on template matching.
 3. Theimage processing apparatus according to claim 2, wherein the seconddetection unit detects the position of the pattern according to acorrelation between an image in a predetermined area and a templateimage which are determined based on the position and the inclinationdetected by the first detection unit.
 4. The image processing apparatusaccording to claim 3, wherein the second detection unit creates thetemplate image based on the inclination of the recording positionadjustment chart and a luminance of a recording medium and a luminanceof the pattern included in the predetermined area.
 5. The imageprocessing apparatus according to claim 4, wherein the second detectionunit creates the template image only for a pattern different inluminance from the pattern whose position has been detected when aplurality of patterns are detected.
 6. The image processing apparatusaccording to claim 1, the image processing apparatus is a recordingapparatus for recording an image on a recording medium using therecording head which discharges ink.
 7. A computer-readable storagemedium storing a program for causing a computer to execute a method forprocessing an image, the method comprising: recording, on a recordingmedium, a recording position adjustment chart including a pattern foradjusting a recording position of a recording head which discharges inkand a mark formed in a position different from a position of thepattern; reading the recording position adjustment chart as image data;detecting a position and inclination of the recording positionadjustment chart when the recording position adjustment chart is readbased on the mark; detecting the position of the pattern based on theposition and the inclination detected by a first detection unit; anddetermining an adjustment value for the recording position adjustmentbased on the image data of the recording position adjustment chart inwhich the position of the pattern has been detected.
 8. A method forprocessing an image, the method comprising: recording, on a recordingmedium, a recording position adjustment chart including a pattern foradjusting a recording position of a recording head which discharges inkand a mark formed in a position different from a position of thepattern; reading the recording position adjustment chart as image data;detecting a position and inclination of the recording positionadjustment chart when the recording position adjustment chart is readbased on the mark; detecting the position of the pattern based on theposition and the inclination detected by a first detection unit; anddetermining an adjustment value for the recording position adjustmentbased on the image data of the recording position adjustment chart inwhich the position of the pattern has been detected.